#include<vector>
using std::vector;


class Solution {
public:
    vector<int> findDisappearedNumbers(vector<int>& nums) {
        int n = nums.size();
        for (auto x: nums) {
            if (x > n) x -= n;
            if (nums[x-1] <= n) nums[x-1] += n;

        }

        vector<int> ans;
        for (int i = 0; i < n; i++) {
            if (nums[i] <= n) ans.push_back(i+1);
        }
        return ans;
    }
}; 